package cn.zust.ly.ExExample.Ex03;

import java.util.Scanner;

/**
 * Created by liy on 2016/11/14.
 */
public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int a = sc.nextInt();
        int s[] = new int[1000001];
        s[0] = s[1] = s[2] = 1;
        for (int i = 3; i <= a; i++) {
            s[i] = (s[i-1] + s[i-2]) % 10007;
        }
        System.out.println(s[a]);

    }



}
